    
    $(function(){
		$(".iCheck-helper").click(function(){
			var state = $(".icheckbox_minimal-purple").attr('aria-checked');
            if(state == 'true') {
                $("input[name='id']").not(':disabled').prop("checked", "checked");
            }else{
                $("input[name='id']").not(':disabled').prop("checked", false);
            }
		});
		
		
		$(document).on('click','input[name="id"]',function(){
			var options = $("[name='id']");
            var i = $("input[name='id']:checked");
            if(i.length == options.length) { 
            	$(".icheckbox_minimal-purple").prop('aria-checked',true);
            	$(".icheckbox_minimal-purple").addClass('checked');
            } else { 
                $(".icheckbox_minimal-purple").prop('aria-checked',false);
            	$(".icheckbox_minimal-purple").removeClass('checked');
            }
        });
        
        /**批量同步**/
        $('a[name="synchro"]').click(function(){
    		var arr = new Array();
            $("input[name='id']:checkbox[checked]").each(function(i){
                arr[i] = $(this).val();
            });
            var ids = arr.join(",");
            //console.log(ids);
            if(ids == ""){
            	layer.msg('请先选择要同步的数据！', {icon: 2,time: 3000});
            	return false;
            }
            
            var data_url = $("#synchro").attr('data-url');
            var g = $("input[name='g']").val();
            
            var url = data_url+'&g='+g+'&ids='+ids;
            //console.log(url)
    		layer.open({
    			skin: 'layui-layer-molv'
    			,type: 2
    			,area: ['750px', '600px']
    			,title:'同步'
    			,content: url
    		});
        });  
        
        /**单独同步**/
        $(document).on('click','a[name="synchro_one"]',function(){
        	var id = $(this).attr('data-id');
        	if(id == ""){
            	layer.msg('请先选择要同步的数据！', {icon: 2,time: 3000});
            	return false;
            }
        	var data_url = $("#synchro").attr('data-url');
            var g = $("input[name='g']").val();
            
            var url = data_url+'&g='+g+'&ids='+id;
    		layer.open({
    			skin: 'layui-layer-molv'
    			,type: 2
    			,area: ['750px', '600px']
    			,title:'同步'
    			,content: url
    		});        	
        });
        
        
        
        
        /**批量同步222**/
        $('a[name="ac_synchro"]').click(function(){
    		var arr = new Array();
    		var show_status_arr = new Array();
    		var data_tmp_arr = new Array();
    		var tmp = Date.parse( new Date() ).toString();
            $("input[name='id']:checkbox[checked]").each(function(i){
                arr[i] = $(this).val();
                show_status_arr[i] = $(this).attr('data-status');
                data_tmp_arr[i] = $(this).attr('data-tmp');
            });
            var ids = arr.join(",");
            //console.log(ids);
            if(ids == ""){
            	layer.msg('请先选择要同步的数据！', {icon: 2,time: 3000});
            	return false;
            }
            
            var show_flag = true;
            var info = '未同步且开始时间大于当前时间的活动才能进行同步，序号为 ';
            for(i = 0; i < show_status_arr.length; i++) {
                //console.log(show_status_arr[i]);
                if (show_status_arr[i] != 1 || tmp > data_tmp_arr[i]) {
                	/**测试所户**/
                	show_flag = false;
                	/**测试所户**/
                	info += arr[i] + ', ';
                }
            }
            info = info.substr(0,info.length-2);
            info += ' 的数据不符合同步的条件';
            if(!show_flag){
                layer.alert(info, {icon: 2, skin: 'layui-layer-molv'});
            	return false;
            }
            
            var data_url = $("#synchro").attr('data-url');
            var g = $("input[name='g']").val();
            
            var url = data_url+'&g='+g+'&ids='+ids;
            //console.log(url)
    		layer.open({
    			skin: 'layui-layer-molv'
    			,type: 2
    			,area: ['750px', '600px']
    			,title:'同步'
    			,content: url
    		});
        });  
        

        
        /**批量作废**/
        $('a[name="active_cancle"]').click(function(){
        	var arr = new Array();
            $("input[name='id']:checkbox[checked]").each(function(i){
                arr[i] = $(this).val();
            });
            var ids = arr.join(",");
            //console.log(ids);
            if(ids == ""){
            	layer.msg('请先选择要作废的数据！', {icon: 2,time: 3000});
            	return false;
            }
            avtivityUpdateStatus(ids,2);
        });
        
        /**单独作废**/
        $(document).on('click','a[name="active_cancle_one"]',function(){
        	var ids = $(this).attr('data-id');
        	if(ids == ""){
            	layer.msg('请先选择要作废的数据！', {icon: 2,time: 3000});
            	return false;
            }
        	avtivityUpdateStatus(ids,2);
        });
        
        /**批量关闭**/
        $('a[name="active_close"]').click(function(){
        	var arr = new Array();
            $("input[name='id']:checkbox[checked]").each(function(i){
                arr[i] = $(this).val();
            });
            var ids = arr.join(",");
            //console.log(ids);
            if(ids == ""){
            	layer.msg('请先选择要关闭的数据！', {icon: 2,time: 3000});
            	return false;
            }
            avtivityUpdateStatus(ids,1);
        });
        
        /**单独关闭**/
        $(document).on('click','a[name="active_close_one"]',function(){
        	var ids = $(this).attr('data-id');
        	if(ids == ""){
            	layer.msg('请先选择要关闭的数据！', {icon: 2,time: 3000});
            	return false;
            }
        	avtivityUpdateStatus(ids,1);
        });
        
        /**批量开启**/
        $('a[name="active_open"]').click(function(){
        	var arr = new Array();
            $("input[name='id']:checkbox[checked]").each(function(i){
                arr[i] = $(this).val();
            });
            var ids = arr.join(",");
            //console.log(ids);
            if(ids == ""){
            	layer.msg('请先选择要开启的数据！', {icon: 2,time: 3000});
            	return false;
            }
            avtivityUpdateStatus(ids,0);
        });
        
        /**单独开启**/
        $(document).on('click','a[name="active_open_one"]',function(){
        	var ids = $(this).attr('data-id');
        	if(ids == ""){
            	layer.msg('请先选择要开启的数据！', {icon: 2,time: 3000});
            	return false;
            }
        	avtivityUpdateStatus(ids,0);
        });
        
        function avtivityUpdateStatus(ids,type){
        	var type_text = '';
        	if(type == 2){
        		type_text = '作废';
        	}
        	if(type == 0){
        		type_text = '开启';
        	}
        	if(type == 1){
        		type_text = '关闭';
        	}
        	var loading = null;
        	layer.confirm('确定'+type_text+'!', {
        			btn: ['确定','取消'] //按钮
        			,skin: 'layui-layer-molv'
        	}, function(){
        	        var data_url = $("#active_cancle").attr('data-url');
                    var g = $("input[name='g']").val();
                    var url = data_url+'&g='+g;
                    uploading = layer.load(1, {shade: [0.4, '#393D49']});
                    $.ajax({
        	        	type : 'POST',
    			        url : url,
				        data : {'ids':ids,'type':type},
				        dataType :'JSON',
				        success : function(res){
				        	layer.close(uploading);
				        	if(res.status == 1){
				        		layer.alert(res.msg, {
				        			skin: 'layui-layer-molv' //样式类名
						            ,closeBtn: 0
					            }, function(){
						             window.location.reload();
					            });	
				        		//layer.alert(res.msg, {skin: 'layui-layer-molv'});
					        }else{
						        layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
					        }
				        }
			        });
                    
        	    }, function(){
        			//取消
        		});
        }
        
        /**查看详情**/
        $(document).on('click','a[name="synchro_info_view"]',function(){
        	var data_url = $(this).attr('data-url');
        	var id = $(this).attr('data-id');
            var g = $("input[name='g']").val();
            
            var url = data_url+'&g='+g+'&id='+id;
            var top_current_page = $(".top_current_page").attr("value");
            var href = funcUrlDel("page")
            //var href = window.location.href;
            //console.log(href);
    		layer.open({
    			skin: 'layui-layer-molv'
    			,btn: ['关闭']
    			,type: 2
    			,area: ['500px', '600px']
    			,title:'同步信息'
    			,content: url
    			,yes: function(index, layero){
    				layer.close(index);
    				window.location.href= href+'&page='+top_current_page  				
    			}
    			,cancel: function(){
    				window.location.href= href+'&page='+top_current_page   				
    			}
    		});
        });
        
        //后端版本更新
        $('a[name="version_update"]').click(function(){
    		var arr = new Array();
            $("input[name='id']:checkbox[checked]").each(function(i){
                arr[i] = $(this).val();
            });
            var ids = arr.join(",");
            if(ids == ""){
            	layer.msg('请先选择要要版本更新的数据！', {icon: 2,time: 3000});
            	return false;
            }
                    
            var data_url = $('a[name="version_update"]').attr('data-url');
            var g = $("input[name='g']").val();
            
            var url = data_url+'&g='+g+'&ids='+ids;
    		layer.open({
    		    skin: 'layui-layer-molv'
    		    ,btn: ['取消', '完成']
    			,type: 2
    			,area: ['750px', '600px']
    			,title:'后端版本更新'
    			,content: url
    			,yes: function(index, layero){
                   //按钮【按钮一】的回调
                   var cz_status = $('input[name="cz_status"]').val();
                   console.log(cz_status);
                   if(cz_status == 0){
                   	 layer.close(index);
                   }else if(cz_status == 6){
                   	 layer.msg('操作已经完成,请点击完成', {icon: 1,time: 3000});
                   }else{
                   	 layer.msg('操作未完成,不能取消,当前操作到第'+cz_status+'步，请继续操作', {icon: 2,time: 3000});
                   }
                   
                }
                ,btn2: function(index, layero){
                   //按钮【按钮二】的回调
                   var cz_status = $('input[name="cz_status"]').val();
                   console.log(cz_status);
                   if(cz_status == 0){
                   	  layer.msg('还未进行操作，可以点击取消', {icon: 1,time: 3000});
                   	  return false;
                   }else if(cz_status == 6){
                   	    layer.alert('操作完成', {
				        	skin: 'layui-layer-molv' //样式类名
						    ,closeBtn: 0
					     }, function(){
						    window.location.reload();
					     }); 
                   	  //layer.msg('操作完成', {icon: 2,time: 3000});
                   }else{
                   	  layer.msg('操作未完成,不能取消,当前操作到第'+cz_status+'步，请继续操作', {icon: 2,time: 3000});
                   	  return false;
                   }
    
                   //return false 开启该代码可禁止点击该按钮关闭
                },cancel: function(){ 
                	var cz_status = $('input[name="cz_status"]').val();
                	if(cz_status == 0 ){
                		layer.msg('取消操作', {icon: 1,time: 3000});
                	}else if(cz_status == 6){
                		layer.msg('操作已经完成,请点击完成', {icon: 1,time: 3000});
                		return false;
                	}else{
                		layer.msg('操作未完成,不能取消,当前操作到第'+cz_status+'步，请继续操作', {icon: 2,time: 3000});
                		return false;
                	}
                   //右上角关闭回调
    
                   //return false 开启该代码可禁止点击该按钮关闭
                }
    		});
        	
        });  
        
        //开服
        $('a[name="open_server"]').click(function(){
        	var tmp = Date.parse( new Date() ).toString();
            tmp = tmp.substr(0,10);  //获取当前时间戳
        	var loading = null;
        	layer.confirm('确定开服!', {
        			btn: ['确定','取消'] //按钮
        			,skin: 'layui-layer-molv'
        		}, function(){
        			var arr = new Array();
    		        var show_status_arr = new Array();
    		        var data_tmp_arr = new Array();
    		        var data_wlk_arr = new Array();
                    $("input[name='id']:checkbox[checked]").each(function(i){
                    	arr[i] = $(this).val();
                        show_status_arr[i] = $(this).attr('data-status');
                        data_tmp_arr[i] = $(this).attr('data-tmp');
                        data_wlk_arr[i] = $(this).attr('data-wlk');
                    });
                    var ids = arr.join(",");
                    
                    //var show_status = show_status_arr.join(",");
                    //console.log(ids);
                    //console.log(show_status);
                    //console.log(data_tmp_arr);
                    var show_flag = true;
                    var info = '表现状态须为 特殊状态或维护状态 且开服状态为 已停服 且 开服时间小于当前时间的服务器才能进行开服，序号为 ';
                    for(i = 0; i < show_status_arr.length; i++) {
                    	//console.log(show_status_arr[i]);
                    	if (show_status_arr[i] != 2 && show_status_arr[i] != 3 || data_tmp_arr[i] > tmp || data_wlk_arr[i] != 2) {
                	        show_flag = false;
                	        info += arr[i] + ', ';
                        }
                    }
                    info = info.substr(0,info.length-2);
                    info += ' 的数据不符合开服的条件';
                    if(!show_flag){
                    	layer.alert(info, {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    if(ids == ""){
                    	layer.alert('请先选择要开服的数据！', {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    uploading = layer.load(2, {shade: [0.4, '#393D49']});
                    var data_url = $('a[name="open_server"]').attr('data-url');
                    var g = $("input[name='g']").val();
                    var url = data_url+'&g='+g;
                    $.ajax({
        	        	type : 'POST',
    			        url : url,
				        data : {'ids':ids},
				        dataType :'JSON',
				        success : function(res){
				        	layer.close(uploading);
				        	if(res.status == 1){
				        		layer.alert(res.msg, {
				        			skin: 'layui-layer-molv' //样式类名
						            ,closeBtn: 0
					            }, function(){
						             window.location.reload();
					            });	
				        		//layer.alert(res.msg, {skin: 'layui-layer-molv'});
					        }else{
						        layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
					        }
				        }
			        });

        		}, function(){
        			//取消
        		});
        });
        
        
        //停服
        $('a[name="stop_server"]').click(function(){
        	var tmp = Date.parse( new Date() ).toString();
            tmp = tmp.substr(0,10);  //获取当前时间戳
        	var loading = null;
        	layer.confirm('确定停服!', {
        			btn: ['确定','取消'] //按钮
        			,skin: 'layui-layer-molv'
        		}, function(){
        			var arr = new Array();
    		        var show_status_arr = new Array();
    		        var data_tmp_arr = new Array();
    		        var data_wlk_arr = new Array();
                    $("input[name='id']:checkbox[checked]").each(function(i){
                    	arr[i] = $(this).val();
                        show_status_arr[i] = $(this).attr('data-status');
                        data_tmp_arr[i] = $(this).attr('data-tmp');
                        data_wlk_arr[i] = $(this).attr('data-wlk');
                    });
                    var ids = arr.join(",");
                    
                    var show_flag = true;
                    var info = '表现状态须为 正常状态或特殊状态 且 开服状态为 已开服 的服务器才能进行停服，序号为 ';
                    for(i = 0; i < show_status_arr.length; i++) {
                    	//console.log(show_status_arr[i]);
                    	if (show_status_arr[i] != 1 && show_status_arr[i] != 2 || data_wlk_arr[i] != 1) {
                	        show_flag = false;
                	        info += arr[i] + ', ';
                        }
                    }
                    info = info.substr(0,info.length-2);
                    info += ' 的数据不符合停服的条件';
                    if(!show_flag){
                    	layer.alert(info, {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    if(ids == ""){
                    	layer.alert('请先选择要停服的数据！', {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    uploading = layer.load(2, {shade: [0.4, '#393D49']});
                    var data_url = $('a[name="stop_server"]').attr('data-url');
                    var g = $("input[name='g']").val();
                    var url = data_url+'&g='+g;
                    $.ajax({
        	        	type : 'POST',
    			        url : url,
				        data : {'ids':ids},
				        dataType :'JSON',
				        success : function(res){
				        	layer.close(uploading);
				        	if(res.status == 1){
				        		layer.alert(res.msg, {
				        			skin: 'layui-layer-molv' //样式类名
						            ,closeBtn: 0
					            }, function(){
						             window.location.reload();
					            });				        		
				        		//layer.alert(res.msg, {skin: 'layui-layer-molv'});
					        }else{
						        layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
					        }
				        }
			        });
                    
                   //layer.alert('完成！', {icon: 1, skin: 'layui-layer-molv'});       			
        		}, function(){
        			//取消
        		});       	
        });
        
        
        
        //清档
        $('a[name="clear_gear"]').click(function(){
        	var tmp = Date.parse( new Date() ).toString();
            tmp = tmp.substr(0,10);  //获取当前时间戳
        	var loading = null;
        	layer.confirm('确定清档!', {
        			btn: ['确定','取消'] //按钮
        			,skin: 'layui-layer-molv'
        		}, function(){
        			var arr = new Array();
    		        var show_status_arr = new Array();
    		        var data_tmp_arr = new Array();
    		        var data_wlk_arr = new Array();
                    $("input[name='id']:checkbox[checked]").each(function(i){
                    	arr[i] = $(this).val();
                        show_status_arr[i] = $(this).attr('data-status');
                        data_tmp_arr[i] = $(this).attr('data-tmp');
                        data_wlk_arr[i] = $(this).attr('data-wlk');
                    });
                    var ids = arr.join(",");
                    
                    //var show_status = show_status_arr.join(",");
                    //console.log(ids);
                    //console.log(show_status);
                    //console.log(data_tmp_arr);
                    var show_flag = true;
                    var info = '表现状态须为 特殊状态或维护状态 且开服状态为 已停服 且 开服时间大于当前时间 的服务器才能进行清档，序号为 ';
                    for(i = 0; i < show_status_arr.length; i++) {
                    	//console.log(show_status_arr[i]);
                    	if (show_status_arr[i] != 2 && show_status_arr[i] != 3 || data_tmp_arr[i] < tmp || data_wlk_arr[i] != 2) {
                	        show_flag = false;
                	        info += arr[i] + ', ';
                        }
                    }
                    info = info.substr(0,info.length-2);
                    info += ' 的数据不符合清档的条件';
                    if(!show_flag){
                    	layer.alert(info, {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    if(ids == ""){
                    	layer.alert('请先选择要清档的数据！', {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    uploading = layer.load(2, {shade: [0.4, '#393D49']});
                    var data_url = $('a[name="clear_gear"]').attr('data-url');
                    var g = $("input[name='g']").val();
                    var url = data_url+'&g='+g;
                    $.ajax({
        	        	type : 'POST',
    			        url : url,
				        data : {'ids':ids},
				        dataType :'JSON',
				        success : function(res){
				        	layer.close(uploading);
				        	if(res.status == 1){
				        		layer.alert(res.msg, {
				        			skin: 'layui-layer-molv' //样式类名
						            ,closeBtn: 0
					            }, function(){
						             window.location.reload();
					            });	
				        		//layer.alert(res.msg, {skin: 'layui-layer-molv'});
					        }else{
						        layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
					        }
				        }
			        });	
        		}, function(){
        			//取消
        		});
        });
        
        
        //状态修改
        $('a[name="update_show_status"]').click(function(){
        	var tmp = Date.parse( new Date() ).toString();
            tmp = tmp.substr(0,10);  //获取当前时间戳
        	var loading = null;
        	layer.confirm('确定把表现状态修改为正常状态!', {
        			btn: ['确定','取消'] //按钮
        			,skin: 'layui-layer-molv'
        		}, function(){
        			var arr = new Array();
    		        var show_status_arr = new Array();
    		        var data_tmp_arr = new Array();
    		        var data_wlk_arr = new Array();
                    $("input[name='id']:checkbox[checked]").each(function(i){
                    	arr[i] = $(this).val();
                        show_status_arr[i] = $(this).attr('data-status');
                        data_tmp_arr[i] = $(this).attr('data-tmp');
                        data_wlk_arr[i] = $(this).attr('data-wlk');
                    });
                    var ids = arr.join(",");
                    
                    var show_flag = true;
                    var info = '表现状态须为 特殊状态 且开服状态为 已开服  的服务器才能把表现状态切换为正常状态，序号为 ';
                    for(i = 0; i < show_status_arr.length; i++) {
                    	if (show_status_arr[i] != 2 || data_wlk_arr[i] != 1) {
                	        show_flag = false;
                	        info += arr[i] + ', ';
                        }
                    }
                    info = info.substr(0,info.length-2);
                    info += ' 的数据不符合切换的条件';
                    if(!show_flag){
                    	layer.alert(info, {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    if(ids == ""){
                    	layer.alert('请先选择要切换的数据！', {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    uploading = layer.load(2, {shade: [0.4, '#393D49']});
                    var data_url = $('a[name="update_show_status"]').attr('data-url');
                    var g = $("input[name='g']").val();
                    var url = data_url+'&g='+g;
                    $.ajax({
        	        	type : 'POST',
    			        url : url,
				        data : {'ids':ids},
				        dataType :'JSON',
				        success : function(res){
				        	layer.close(uploading);
				        	if(res.status == 1){
				        		layer.alert(res.msg, {
				        			skin: 'layui-layer-molv' //样式类名
						            ,closeBtn: 0
					            }, function(){
						             window.location.reload();
					            });	
				        		//layer.alert(res.msg, {skin: 'layui-layer-molv'});
					        }else{
						        layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
					        }
				        }
			        });	
        		}, function(){
        			//取消
        		});
        });
        
        //批量修改状态为正常
        $(document).on('click','a[name="updateStatusOne"]',function(){
        	updateStatus(1);
        });
        
        //批量修改状态为特殊状态
        $(document).on('click','a[name="updateStatusTwo"]',function(){
        	updateStatus(2);
        });
        
        //批量修改状态为维护
        $(document).on('click','a[name="updateStatusThree"]',function(){
        	updateStatus(3);
        });
        
        
        
	});
	
        function updateStatus(show_status){
        	var show_status_text = '';
        	if(show_status == 1){
        		show_status_text = '正常';
        	}
        	if(show_status == 2){
        		show_status_text = '特殊状态';
        	}
        	if(show_status == 3){
        		show_status_text = '维护';
        	}
	        var loading = null;
        	layer.confirm('确定切换表现状态为'+show_status_text+'!', {
        			btn: ['确定','取消'] //按钮
        			,skin: 'layui-layer-molv'
        	    }, function(){
        	    	var arr = new Array();
    		        var show_status_arr = new Array();   		        
                    $("input[name='id']:checkbox[checked]").each(function(i){
                    	arr[i] = $(this).val();
                        show_status_arr[i] = $(this).attr('data-status');
                    });
                    var ids = arr.join(",");
                    if(ids == ""){
                    	layer.alert('请先选择要切换的数据！', {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    var show_flag = true;
                    var info = '序号为 ';
                    for(i = 0; i < show_status_arr.length; i++) {
                    	//console.log(show_status_arr[i]);
                    	if (show_status_arr[i] == show_status) {
                	        show_flag = false;
                	        info += arr[i] + ', ';
                        }
                    }
                    info = info.substr(0,info.length-2);
                    info += ' 的数据不符合把表现状态切换为'+show_status_text+'的条件';
                    if(!show_flag){
                    	layer.alert(info, {icon: 2, skin: 'layui-layer-molv'});
            	        return false;
                    }
                    
                    uploading = layer.load(2, {shade: [0.4, '#393D49']});
                    var data_url = $('a[name="updateStatusOne"]').attr('data-url');
                    var g = $("input[name='g']").val();
                    var url = data_url+'&g='+g;
                    $.ajax({
        	        	type : 'POST',
    			        url : url,
				        data : {'ids':ids,'status':show_status},
				        dataType :'JSON',
				        success : function(res){
				        	layer.close(uploading);
				        	if(res.status == 1){
				        		layer.alert(res.msg, {
				        			skin: 'layui-layer-molv' //样式类名
						            ,closeBtn: 0
					            }, function(){
						             window.location.reload();
					            });	
				        		//layer.alert(res.msg, {skin: 'layui-layer-molv'});
					        }else{
						        layer.alert(res.msg, {icon: 2, skin: 'layui-layer-molv'});
					        }
				        }
			        });
                    
                    
        		
        		}, function(){
        			//取消
        		});
        }
	

//判断数组里面的值是否都相等
function isAllEqual(array){
    if(array.length>0){
       return !array.some(function(value,index){
         return value !== array[0];
       });   
    }else{
        return true;
    }
}


// 删除url中某个参数,并跳转
function funcUrlDel(name){
    var loca = window.location;
    var baseUrl = loca.origin + loca.pathname + "?";
    var query = loca.search.substr(1);
    console.log(loca)
    console.log(baseUrl)
    console.log(query)
    if (query.indexOf(name)>-1) {
        var obj = {}
        var arr = query.split("&");
        for (var i = 0; i < arr.length; i++) {
            arr[i] = arr[i].split("=");
            obj[arr[i][0]] = arr[i][1];
        };
        delete obj[name];
        var url = baseUrl + JSON.stringify(obj).replace(/[\"\{\}]/g,"").replace(/\:/g,"=").replace(/\,/g,"&");
        return url;
    }else{
    	var url = baseUrl + query;
    	return url
    }
}